import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import oxlintPlugin from './vite-plugin-oxlint/index.js'
const oxlintPluginConfig = {
  path: 'src',
  params: [
    '-c',
    `${path.join(process.cwd(), 'oxlintrc.json')}`,
    '--ignore-path',
    `${path.join(process.cwd(), '.eslintignore')}`,
    '--disable-react-plugin',
    '--disable-unicorn-plugin',
    '--disable-typescript-plugin',
    '--promise-plugin',
    '--jsx-a11y-plugin',
    // '--fix', 更多提示输出对电脑性能开销太大。建议关闭
    '--deny-warnings',
    `${path.join(process.cwd(), 'src')}`
  ],
}
// https://vitejs.dev/config/
export default defineConfig({
  // plugins: [vue()],
  plugins: [
    vue(),
    oxlintPlugin(oxlintPluginConfig)
  ],
})
